package com.ks.core.framework.cpsupload.demos.pay1;

import com.ks.core.framework.cpsupload.demos.pay.PaymentChannel;
import com.ks.core.framework.cpsupload.demos.pay.PaymentOperation;

// 退款参数基类
public abstract class BaseRefundParams extends BasePaymentParams implements RefundParams {
    protected String originalTransactionId;
    protected Double refundAmount;
    protected String refundReason;
    
    public BaseRefundParams(PaymentChannel channel) {
        super(channel, PaymentOperation.REFUND);
    }

    @Override
    public void validate() {
        if (originalTransactionId == null || originalTransactionId.isEmpty()) {
            throw new IllegalArgumentException("原交易号必填");
        }
        if (refundAmount == null || refundAmount <= 0) {
            throw new IllegalArgumentException("退款金额无效");
        }
    }
}